C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.5
C---------------------------------------------------------
        PROGRAM ISTPO
 
C ----------------------------------------------------------------------
C
C       I S T P O   -   P O L I S H   O P T I O N S   E D I T O R
C       =========       =========================================
C
C ----------------------------------------------------------------------
 
        INTEGER CMDTBL(45),MENTBL(83),MENTBX(10)
 
        INTEGER PROMPT(5),FPRMPT(19),MPRMPT(12),VPRMPT(18,9)
 
        SAVE
 
        INTEGER OPTPTH(81),IODOPT,JUNK,CMD(134),MENU,CMDLEN,
     +          CMDNUM,KEYWRD(134),PNTR,REST(134),TEMP
        LOGICAL VERBOS
 
        INTEGER OPEN,GETARG,ZKWLUK,ZGTCMD,GETWRD,ZYESNO
        EXTERNAL OPEN,GETARG,ZKWLUK,ZGTCMD,GETWRD,ZPRMPT,ZYESNO,CANT,
     +           ZINIT,ZQUIT,SKIPBL,SKIP
 
        DATA CMDTBL/9,
     +       63,129,
     +       101,120,105,116,129,
     +       104,101,108,112,129,
     +       109,101,110,117,129,
     +       110,101,120,116,129,
     +       113,117,101,114,121,129,
     +       113,117,105,116,129,
     +       114,101,97,100,129,
     +       119,114,105,116,101,129/
 
        DATA MENTBL/10,
     +       98,97,115,105,99,129,
     +       98,108,97,110,107,95,108,105,110,101,
     +115,129,
     +       99,111,109,109,111,110,129,
     +       99,111,110,118,101,114,115,105,111,110,129,
     +       100,105,114,129,
     +       108,105,110,101,95,98,114,101,97,107,129,
     +       115,112,97,99,105,110,103,49,129,
     +       115,112,97,99,105,110,103,50,129,
     +       116,111,112,129,
     +       117,110,99,111,109,109,111,110,129/
 
        DATA MENTBX/2,6,3,5,1,7,8,9,1,4/
 
        DATA PROMPT/80,79,62,32,129/
 
        DATA FPRMPT/79,112,116,105,111,110,32,102,105,108,
     +              101,32,110,97,109,101,58,32,129/
 
        DATA MPRMPT/77,101,110,117,32,110,97,109,101,
     +              58,32,129/
 
        DATA (VPRMPT(I,1),I=1,10)/80,79,40,100,105,114,
     +        41,62,32,129/
        DATA (VPRMPT(I,2),I=1,12)/80,79,40,98,97,115,
     +        105,99,41,62,32,129/
        DATA (VPRMPT(I,3),I=1,13)/80,79,40,99,111,109,
     +        109,111,110,41,62,32,129/
        DATA (VPRMPT(I,4),I=1,15)/80,79,40,117,110,99,
     +        111,109,109,111,110,41,62,32,129/
        DATA (VPRMPT(I,5),I=1,17)/80,79,40,99,111,110,
     +        118,101,114,115,105,111,110,
     +        41,62,32,129/
        DATA (VPRMPT(I,6),I=1,18)/80,79,40,98,108,97,
     +        110,107,95,108,105,110,101,115,41,
     +        62,32,129/
        DATA (VPRMPT(I,7),I=1,17)/80,79,40,108,105,110,
     +        101,95,98,114,101,97,107,41,62,
     +        32,129/
        DATA (VPRMPT(I,8),I=1,15)/80,79,40,115,112,97,
     +        99,105,110,103,49,41,62,32,129/
        DATA (VPRMPT(I,9),I=1,15)/80,79,40,115,112,97,
     +        99,105,110,103,50,41,62,32,129/
 
        CALL ZINIT
 
        IF (GETARG(1,OPTPTH,81).EQ.-100) THEN
            CALL ZPRMPT(FPRMPT)
            JUNK=ZGTCMD(OPTPTH,0)
            IF (JUNK.EQ.-100 .OR. JUNK.EQ.129) CALL ERROR
     +          ('Option file name must be specified.')
        END IF
 
C Read previous option file
 
        IODOPT=OPEN(OPTPTH,0)
        IF (IODOPT.EQ.-1) THEN
            CALL ZMESS('[New file]',1)
        ELSE
            CALL ZMESS('[Reading old file......]',1)
 100        IF (ZGTCMD(CMD,IODOPT).NE.-100) THEN
                CALL POLOPT(CMD,.FALSE.)
                GOTO 100
            END IF
            CALL CLOSE(IODOPT)
        END IF
 
C Initialise menu system
 
        MENU=1
        VERBOS=.FALSE.
 
C Main loop
 
 200    CALL SKIP(1)
        IF (VERBOS) THEN
            CALL ZPRMPT(VPRMPT(1,MENU))
        ELSE
            CALL ZPRMPT(PROMPT)
        END IF
        CMDLEN=ZGTCMD(CMD,0)
        IF (CMDLEN.EQ.0) GOTO 200
        PNTR=1
        IF (GETWRD(CMD,PNTR,KEYWRD).LE.0) GOTO 200
        CALL SKIPBL(CMD,PNTR)
        CALL SCOPY(CMD,PNTR,REST,1)
        CMDNUM=ZKWLUK(KEYWRD,CMDTBL)
        IF (CMDNUM.GT.0) THEN
            GOTO (1001,1002,1003,1004,1005,1006,1007,1008,1009) CMDNUM
        ELSE IF (CMDNUM.EQ.0) THEN
            CALL REMARK('Ambiguous command')
        ELSE
            CALL POLOPT(CMD,.FALSE.)
        END IF
        GOTO 200
 
C ****************************************
C *
C *     Basic command routines
C *
C ****************************************
 
C ?
 1001   CALL ZMESS(
     +'Commands are: Exit, Help, Menu, Next, Query, Quit, Read, Write',
     +       1)
        CALL PUTC(10)
        CALL ZMESS('To set a parameter, type:',1)
        CALL ZMESS('    param=value.',1)
        CALL PUTC(10)
        GOTO 200
 
C Exit
 1002   IF (REST(1).NE.129) THEN
            CALL REMARK('The EXIT comand should have n'//'o parameters')
        ELSE
            CALL WRFILE(OPTPTH)
            CALL ZQUIT(-2)
        END IF
        GOTO 200
 
C Help
 1003   CALL HELP(REST,MENU)
        VERBOS=.TRUE.
        GOTO 200
 
C Menu
 1004   IF (REST(1).EQ.129) THEN
            CALL HELP(REST,MENU)
            VERBOS=.TRUE.
            GOTO 200
        END IF
        TEMP=ZKWLUK(REST,MENTBL)
        IF (TEMP.GT.0) THEN
            MENU=MENTBX(TEMP)
            REST(1)=129
            CALL HELP(REST,MENU)
        ELSE IF (TEMP.EQ.0) THEN
            CALL REMARK('Ambiguous menu name')
        ELSE
            CALL REMARK('Unknown menu name')
        END IF
        GOTO 200
 
C Next
 1005   IF (REST(1).NE.129) THEN
            CALL REMARK('The NEXT command must have n'//'o parameters')
        ELSE
            MENU=MENU+1
            IF (MENU.GT.9) MENU=1
            CALL HELP(REST,MENU)
        END IF
        GOTO 200
 
C Query
 1006   CALL POLOPT(CMD,.FALSE.)
        GOTO 200
 
C Quit
 1007   CALL ZMESS('Quit ISTPO a'//'nd n'//'ot wr'//
     +             'ite the options file?',1)
        IF (ZYESNO(-2).EQ.-2) THEN
            CALL ZMESS('ISTPO terminated, file n'//'ot written',1)
            CALL ZQUIT(-2)
        END IF
        CALL ZMESS('Quit command aborted',1)
        GOTO 200
 
C Read
 1008   IF (REST(1).EQ.129) THEN
            CALL ZPRMPT(FPRMPT)
            JUNK=ZGTCMD(REST,0)
        END IF
        IODOPT=OPEN(REST,0)
        IF (IODOPT.EQ.-1) THEN
            CALL CANT(REST)
        ELSE
 2000       IF (ZGTCMD(CMD,IODOPT).NE.-100) THEN
                CALL POLOPT(CMD,.FALSE.)
                GOTO 2000
            END IF
            CALL CLOSE(IODOPT)
        END IF
        GOTO 200
 
C Write
 1009   IF (REST(1).NE.129) CALL SCOPY(REST,1,OPTPTH,1)
        CALL WRFILE(OPTPTH)
        GOTO 200
 
        END
C ----------------------------------------------------------------------
C
C        H E L P  -  Display help
C
 
        SUBROUTINE HELP(TOPIC,MENU)
        INTEGER TOPIC(*),MENU
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.5
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        COMMON/MARGIN/LMARGS,RMARGS,LMARGC,RMARGC
        INTEGER LMARGS,RMARGS,LMARGC,RMARGC
 
        COMMON/CONTIN/CONCHR,CONCNT
        INTEGER CONCHR,CONCNT
 
        COMMON/LFORM/LABELF,LABELC
        INTEGER LABELF,LABELC
 
        COMMON/INDENT/INDDO,INDIF,INDCON,INDCMT,MAXIND
        INTEGER INDDO,INDIF,INDCON,MAXIND
        LOGICAL INDCMT
 
        COMMON/SEQNUM/SEQINI,SEQINC,SEQDIG,SEQFIL,SEQRQD
        INTEGER SEQINI,SEQINC,SEQDIG,SEQFIL
        LOGICAL SEQRQD
 
        COMMON/SPACNG/SPBEF,SPAFT
        INTEGER SPBEF(-2:TKLAST,0:2),SPAFT(-2:TKLAST,0:2)
 
        COMMON/INTBRK/BRPRIO
        INTEGER BRPRIO(-2:TKLAST,0:2)
 
        COMMON/BLINES/BLAFT,BLBEF,BLADEC,BLCHAR
        INTEGER BLAFT(-2:TKLAST),BLBEF(-2:TKLAST),BLCHAR
        LOGICAL BLADEC
 
        COMMON/RELBL/FLBINI,FLBINC,SLBINI,SLBINC,RLBFMT,RLBSTM
        INTEGER FLBINI,FLBINC,SLBINI,SLBINC
        LOGICAL RLBFMT,RLBSTM
 
        COMMON/DOCON/DOCONI,NDOCON,DOCONS,IOTHCO
        LOGICAL DOCONI,IOTHCO
        INTEGER NDOCON,DOCONS(30)
 
        COMMON/CMT/CMMODE,CBOX,CBTOP,CBSIDE,CMCHAR
        INTEGER CMMODE,CBOX,CBTOP,CBSIDE,CMCHAR
 
        COMMON/CASE/KWCASE,IDCASE,STRCAS,CMCASE,FFCASE
        INTEGER KWCASE,IDCASE,STRCAS,CMCASE,FFCASE
 
        COMMON/ASGLUP/VLEN
        INTEGER VLEN
 
        COMMON/DECLUP/DLUP,DLEN,DLUPOS
        LOGICAL DLUP
        INTEGER DLEN,DLUPOS
 
        COMMON/MOVFMT/MOVEF,MFFLAG
        LOGICAL MOVEF,MFFLAG
 
        COMMON/TRCOPT/TRACE
        LOGICAL TRACE
 
        COMMON/OPT15C/INDDOC,DELSED,BRKLIF
        LOGICAL INDDOC,DELSED,BRKLIF
 
        COMMON/ERROPT/ERRCMT
        LOGICAL ERRCMT
 
        COMMON/CVTOPT/CVTHFM,FMSBRK
        LOGICAL CVTHFM,FMSBRK
 
        COMMON/REMTOK/RMOPCF
        LOGICAL RMOPCF
 
        COMMON/TNAMES/TOKNAM
        CHARACTER*6 TOKNAM(-2:TKLAST)
 
        INTEGER HLPTOP(93),HLPTBX(14)
        CHARACTER*61 HLPTXT(49)
 
        SAVE
 
        INTEGER TOPNUM,I
 
        INTEGER ZKWLUK
        EXTERNAL ZKWLUK,ZMESS
 
        DATA HLPTOP/14,
     +       63,129,
     +       99,98,111,120,61,129,
     +       99,109,99,104,97,114,61,129,
     +       99,109,109,111,100,101,61,129,
     +       99,111,110,99,104,114,61,129,
     +       101,120,105,116,129,
     +       104,101,108,112,129,
     +       109,101,110,117,129,
     +       110,101,120,116,129,
     +       112,97,114,97,109,101,116,101,114,95,
     +115,101,116,116,105,110,103,129,
     +       113,117,101,114,121,129,
     +       113,117,105,116,129,
     +       114,101,97,100,129,
     +       119,114,105,116,101,129/
 
        DATA (HLPTXT(I),I=1,19)/
     +  'Help is currently available on:.                             ',
     +  '  Exit   Help   Menu   Next   Query  Quit   Read   Write.    ',
     +  '  Parameter_setting.                                         ',
     +  '  CBOX=     CMCHAR=   CMMODE=   CONCHR=.                    )',
     +  'The EXIT command will Write out the option file as modified,.',
     +  'And terminate ISTPO...                                      )',
     +  'The HELP command with No parameters will display the current.',
     +  'menu..  Otherwise the parameter is the name of a topic on.   ',
     +  'which to give help..  A list of topics can be displayed by.  ',
     +  'giving the command "HELP ?"...                              )',
     +  'The MENU command sets the menu..  Its parameter is the name. ',
     +  'of the required menu...                                     )',
     +  'The NEXT command will set the menu to that following the.    ',
     +  'current one...                                              )',
     +  'The QUIT command terminates ISTPO without updating the.      ',
     +  'option file...                                              )',
     +  'To set an ISTPL parameter, type the parameter name followed. ',
     +  'by an Equals sign And then the required value...             ',
     +  '    For example:  PO>RLBFMT=..TRUE...                        '/
        DATA (HLPTXT(I),I=20,38)/
     +  'Note that both the parameter And the value name may be.      ',
     +  'abbreviated, so long as they are still unique...            )',
     +  'The CONCHR parameter determines what character will be used. ',
     +  'in column 6 of continuation lines..  The acceptable values.  ',
     +  'are:    CONCHR=numeric.                                      ',
     +  '        CONCHR=alphabetic.                                   ',
     +  '        CONCHR=alphanumeric.                                 ',
     +'        CONCHR=''*''.                                          ',
     +  '(where * is Any graphic character apart from 0...           )',
     +  'The QUERY command asks that each time an option is changed,. ',
     +  'the user is asked for confirmation..  A second QUERY command.',
     +  'will turn QUERY mode off (after confirmation of course)...  )',
     +  'The READ command reads an option file into memory..  This.   ',
     +  'overwrites Any current option setting...                    )',
     +  'The WRITE command writes out the current option settings to. ',
     +  'an option file..  If No filename is specified after the.     ',
     +  'command, the option file specified at startup is written... )',
     +  'The CMMODE parameter determines the mode of processing.      ',
     +  'comments..  The acceptable values are:.                      '/
        DATA (HLPTXT(I),I=39,49)/
     +  '        CMMODE=normal.                                       ',
     +  '        CMMODE=skip_leading_blanks.                          ',
     +  '        CMMODE=verbatim.                                    )',
     +  'The CBOX parameter determines the decoration applied to.     ',
     +  'comment blocks..  The acceptable values are:.                ',
     +  '        CBOX=none.                                           ',
     +  '        CBOX=half_box.                                       ',
     +  '        CBOX=whole_box.                                     )',
     +  'The CMCHAR parameter determines the character in column of.  ',
     +'comment lines..  The acceptable values are: ''C'', ''c'', ''*'',
     + .',
     +'And '' '' (Blank means the same as in the source)...          )'/
 
        DATA HLPTBX/1,42,47,37,22,5,7,11,13,17,29,15,32,34/
 
        IF (TOPIC(1).EQ.129)
     +      GOTO (1001,1002,1003,1004,1005,1006,1007,1008,1009) MENU
 
        TOPNUM=ZKWLUK(TOPIC,HLPTOP)
        IF (TOPNUM.LE.0) THEN
            IF (TOPNUM.EQ.0) THEN
                CALL REMARK('Ambiguous help topic')
            ELSE
                CALL REMARK('Unknown help topic')
            END IF
            RETURN
        END IF
        I=HLPTBX(TOPNUM)
 
 100    CALL ZMESS(HLPTXT(I),1)
        IF (HLPTXT(I)(61:61).EQ.')') RETURN
        I=I+1
        GOTO 100
 
 1001   CALL ZMESS('ISTPO - Polish Options Editor',1)
        CALL SKIP(1)
        CALL ZMESS('Menu: DIR                      Next: BASIC',1)
        CALL SKIP(1)
        CALL ZMESS('Menus available:',1)
        CALL ZMESS('  BASIC         - Basic Operating Parameters',
     +             1)
        CALL ZMESS('  COMMON        - Commonly-used Options',1)
        CALL ZMESS('  UNCOMMON      - Uncommon Customisations',1)
        CALL ZMESS('  CONVERSION    - Conversion Options',1)
        CALL ZMESS('  BLANK_LINES   - Blank Line Insertion',1)
        CALL ZMESS('  LINE_BREAK    - Long Line Break Priorities',
     +             1)
        CALL ZMESS('  SPACING1      - Token Spacing Parameters',1)
        CALL ZMESS('  SPACING2      - More Token Spacing Parameters',
     +             1)
        CALL SKIP(2)
        CALL ZMESS('To move to a particular menu, type:',1)
        CALL ZMESS('  MENU name',1)
        CALL SKIP(2)
        CALL ZMESS(
     +'Other commands: ?, Exit, Help, Next, Query, Quit, Read, Write',
     +             1)
        CALL SKIP(1)
        RETURN
 
 1002   CALL SKIP(1)
        CALL ZMESS(
     +       'Menu: BASIC                        Next: COMMON',1)
        CALL SKIP(1)
        CALL ZCHOUT('SEQRQD: Add sequence numbers               = ',
     +              1)
        CALL OUTLOG(SEQRQD,1)
        CALL SKIP(1)
        CALL ZCHOUT('RLBFMT: Relabel FORMAT statements          = ',
     +              1)
        CALL OUTLOG(RLBFMT,1)
        CALL ZCHOUT('RLBSTM: Relabel executable statements      = ',
     +              1)
        CALL OUTLOG(RLBSTM,1)
        CALL ZCHOUT('MOVEF : Move FORMAT statements to end      = ',
     +              1)
        CALL OUTLOG(MOVEF,1)
        CALL SKIP(1)
        CALL ZCHOUT('DOCONI: End each DO-loop on a CONTINUE     = ',
     +              1)
        CALL OUTLOG(DOCONI,1)
        CALL ZCHOUT('IOTHCO: Put CONTINUE on each labelled stmt = ',
     +              1)
        CALL OUTLOG(IOTHCO,1)
        CALL SKIP(1)
        CALL ZCHOUT('TRACE : Display progress messages          = ',
     +              1)
        CALL OUTLOG(TRACE,1)
        CALL SKIP(1)
        CALL ZCHOUT('ERRCMT: Insert er'//
     +              'ror messages as comments  = ',1)
        CALL OUTLOG(ERRCMT,1)
        CALL SKIP(1)
        CALL ZCHOUT('CONCHR: Continuation character             = ',
     +              1)
        CALL OUTCCH(CONCHR,1)
        CALL SKIP(2)
        CALL ZMESS('Type ? for help',1)
        CALL SKIP(1)
        RETURN
 
 1003   CALL SKIP(1)
        CALL ZMESS('Menu: COMMON                       Next: UNCOMMON',
     +             1)
        CALL SKIP(1)
        CALL ZCHOUT('SEQINI: Initial Sequence Number          = ',1)
        CALL PUTDEC(SEQINI,1)
        CALL PUTC(10)
        CALL ZCHOUT('SEQINC: Sequence Number Increment        = ',1)
        CALL PUTDEC(SEQINC,1)
        CALL PUTC(10)
        CALL ZCHOUT('SEQDIG: Number of digits in seq num'//
     +              'ber   = ',1)
        CALL PUTDEC(SEQDIG,1)
        CALL PUTC(10)
        CALL ZCHOUT('SEQFIL: Fill character for seq num'//
     +              'ber    = ''',1)
        CALL PUTC(SEQFIL)
        CALL ZMESS('''',1)
        CALL SKIP(1)
        CALL ZCHOUT('SLBINI: Initial statement label          = ',
     +              1)
        CALL PUTDEC(SLBINI,1)
        CALL PUTC(10)
        CALL ZCHOUT('SLBINC: Statement label increment        = ',
     +              1)
        CALL PUTDEC(SLBINC,1)
        CALL PUTC(10)
        CALL ZCHOUT('FLBINI: Initial FORMAT label             = ',
     +              1)
        CALL PUTDEC(FLBINI,1)
        CALL PUTC(10)
        CALL ZCHOUT('FLBINC: FORMAT label increment           = ',
     +              1)
        CALL PUTDEC(FLBINC,1)
        CALL SKIP(2)
        CALL ZCHOUT('INDDO : Indentation within a DO-loop     = ',
     +              1)
        CALL PUTDEC(INDDO,1)
        CALL PUTC(10)
        CALL ZCHOUT('INDIF : Indentation within a block-IF    = ',
     +              1)
        CALL PUTDEC(INDIF,1)
        CALL PUTC(10)
        CALL ZCHOUT('INDCON: Continuation line indentation    = ',
     +              1)
        CALL PUTDEC(INDCON,1)
        CALL PUTC(10)
        CALL ZCHOUT('INDCMT: Indent comments as statements    = ',
     +              1)
        CALL OUTLOG(INDCMT,1)
        CALL ZCHOUT('INDDOC: Indent DO- CONTINUE''s with body  = ',
     +              1)
        CALL OUTLOG(INDDOC,1)
        CALL SKIP(1)
        CALL ZCHOUT('VLEN  : Padding before "=" for variables = .',
     +              1)
        CALL PUTDEC(VLEN,1)
        CALL SKIP(2)
        RETURN
 
 1004   CALL SKIP(1)
        CALL ZMESS('Menu: UNCOMMON                  Next: CONVERSION',
     +             1)
        CALL SKIP(1)
        CALL ZCHOUT('LMARGS: Left margin for statements       = ',
     +              1)
        CALL PUTDEC(LMARGS,1)
        CALL PUTC(10)
        CALL ZCHOUT('RMARGS: Right margin for statements      = ',
     +              1)
        CALL PUTDEC(RMARGS,1)
        CALL PUTC(10)
        CALL ZCHOUT('LMARGC: Left margin for comments         = ',
     +              1)
        CALL PUTDEC(LMARGC,1)
        CALL PUTC(10)
        CALL ZCHOUT('RMARGC: Right margin for comments        = ',
     +              1)
        CALL PUTDEC(RMARGC,1)
        CALL SKIP(2)
        CALL ZCHOUT('LABELC: Starting column for labels       = ',1)
        CALL PUTDEC(LABELC,1)
        CALL PUTC(10)
        CALL ZCHOUT('LABELF: Label format                     = ',1)
        CALL OUTLBF(LABELF,1)
        CALL SKIP(1)
        CALL ZCHOUT('DLEN  : Declaration keyword length       = ',1)
        CALL PUTDEC(DLEN,1)
        CALL PUTC(10)
        CALL ZCHOUT('DLUP  : Declaration body line-up         = ',1)
        CALL OUTLOG(DLUP,1)
        CALL SKIP(1)
        CALL ZCHOUT('CMMODE: Mode of reading comments         = ',
     +              1)
        CALL OUTCMM(CMMODE,1)
        CALL SKIP(1)
        CALL ZCHOUT('CBOX  : Comment boxing                   = ',1)
        CALL OUTCBX(CBOX,1)
        CALL ZCHOUT('CBTOP : Top of box character             = ',1)
        CALL PUTC(39)
        CALL PUTC(CBTOP)
        CALL ZMESS('''',1)
        CALL ZCHOUT('CBSIDE: Sides of box character           = ',1)
        CALL PUTC(39)
        CALL PUTC(CBSIDE)
        CALL ZMESS('''',1)
        CALL SKIP(1)
        CALL ZCHOUT('CMCHAR: Comment character                = ',1)
        CALL PUTC(39)
        CALL PUTC(CMCHAR)
        CALL PUTC(39)
        CALL SKIP(2)
        CALL ZCHOUT('DELSED: Delete $PL$ SED comments         = ',1)
        CALL OUTLOG(DELSED,1)
        CALL SKIP(1)
        RETURN
 
 1005   CALL SKIP(1)
        CALL ZMESS('Menu: CONVERSION                 Next: BLANK_LINES',
     +             1)
        CALL SKIP(1)
        CALL ZCHOUT('KWCASE: Keyword case                     = ',1)
        CALL OUTKWC(KWCASE,1)
        CALL ZCHOUT('IDCASE: Identifier case                  = ',1)
        CALL OUTCAS(IDCASE,1)
        CALL ZCHOUT('STRCAS: String case                      = ',1)
        CALL OUTCAS(STRCAS,1)
        CALL ZCHOUT('CMCASE: Comment case                     = ',1)
        CALL OUTCAS(CMCASE,1)
        CALL ZCHOUT('FFCASE: Format-field case                = ',1)
        CALL OUTCAS(FFCASE,1)
        CALL SKIP(1)
        CALL ZCHOUT('RMOPCF: Remove optional commas in FORMAT = ',1)
        CALL OUTLOG(RMOPCF,1)
        CALL ZCHOUT('CVTHFM: Convert H-field to character str = ',1)
        CALL OUTLOG(CVTHFM,1)
        CALL ZCHOUT('FMSBRK: Break strings in FORMAT cleverly = ',1)
        CALL OUTLOG(FMSBRK,1)
        CALL SKIP(1)
        RETURN
 
 1006   CALL SKIP(1)
        CALL ZMESS('Menu: BLANK_LINES                Next: LINE_BREAK',
     +             1)
        CALL SKIP(1)
        CALL ZCHOUT('BLADEC: Blank line after declarations = ',1)
        CALL OUTLOG(BLADEC,1)
        CALL ZCHOUT('BLCHAR: Blank line initial character  = ',1)
        CALL PUTC(39)
        CALL PUTC(BLCHAR)
        CALL ZMESS('''',1)
        CALL ZMESS('BLAFT(token): Blank line after statement starting wi
     +th token=',1)
        CALL PUTC(32)
        DO 10061 I=TASSIG,TDCMPL
            CALL ZCHOUT('('//TOKNAM(I)//')=',1)
            CALL PUTDEC(BLAFT(I),1)
            IF (MOD(I-1,7).EQ.0) CALL PUTC(10)
            CALL PUTC(32)
10061   CONTINUE
        CALL ZCHOUT('('//TOKNAM(TNAME)//')=',1)
        CALL PUTDEC(BLAFT(TNAME),1)
        CALL PUTC(10)
        CALL ZMESS('BLBEF(token): Blank line before statement starting w
     +ith token=',1)
        CALL PUTC(32)
        DO 10062 I=TASSIG,TDCMPL
            CALL ZCHOUT('('//TOKNAM(I)//')=',1)
            CALL PUTDEC(BLBEF(I),1)
            IF (MOD(I-1,7).EQ.0) CALL PUTC(10)
            CALL PUTC(32)
10062   CONTINUE
        CALL ZCHOUT('('//TOKNAM(TNAME)//')=',1)
        CALL PUTDEC(BLBEF(TNAME),1)
        CALL SKIP(2)
        RETURN
 
 1007   CALL SKIP(1)
        CALL ZMESS('Menu: LINE_BREAK                   Next: SPACING1',
     +             1)
        CALL SKIP(1)
        CALL ZCHOUT('BRKLIF: Break logical IF after cond= ',1)
        CALL OUTLOG(BRKLIF,1)
        CALL ZMESS('BRPRIO(token): Line break priority at parenthesis le
     +vels 0, 1 & 2+',1)
        CALL ZCHOUT(' '//TOKNAM(-2)//'=',1)
        CALL PUTBRP(BRPRIO,-2,1)
        CALL PUTC(32)
        CALL ZCHOUT(TOKNAM(-1)//'=',1)
        CALL PUTBRP(BRPRIO,-1,1)
        CALL PUTC(32)
        DO 10071 I=TASSIG,TZEOS
            CALL ZCHOUT(TOKNAM(I)//'=',1)
            CALL PUTBRP(BRPRIO,I,1)
            IF (MOD(I-1,5).EQ.3) CALL PUTC(10)
10071       CALL PUTC(32)
        CALL ZCHOUT(TOKNAM(TFMTKD)//'=',1)
        CALL PUTBRP(BRPRIO,TFMTKD,1)
        CALL PUTC(10)
        CALL ZCHOUT(' '//TOKNAM(TENDKD)//'=',1)
        CALL PUTBRP(BRPRIO,TENDKD,1)
        CALL ZCHOUT(' '//TOKNAM(TERRKD)//'=',1)
        CALL PUTBRP(BRPRIO,TERRKD,1)
        CALL SKIP(2)
        RETURN
 
 1008   CALL SKIP(1)
        CALL ZMESS('Menu: SPACING1                     Next: SPACING2.',
     +             1)
        CALL SKIP(1)
        CALL ZMESS('SPBEF(token): Spaces before token at parenthesis '//
     +'levels 0, 1 & 2+ =',1)
        DO 10081 I=-2,TKLAST
            IF (I.NE.0 .AND. I.NE.1) THEN
                CALL ZCHOUT(' '//TOKNAM(I)//'=',1)
                CALL ZPTINT(SPBEF(I,0),2,1)
                CALL PUTC(44)
                CALL ZPTINT(SPBEF(I,1),2,1)
                CALL PUTC(44)
                CALL ZPTINT(SPBEF(I,2),2,1)
                IF (I.GT.0 .AND. MOD(I-1,5).EQ.3) CALL PUTC(10)
            END IF
10081   CONTINUE
        CALL SKIP(2)
        RETURN
 
 1009   CALL SKIP(1)
        CALL ZMESS('Menu: SPACING2                     Next: DIR',
     +             1)
        CALL SKIP(1)
        CALL ZMESS('SPAFT(token): Spaces after token at parenthesis '//
     +'levels 0, 1 & 2+ =',1)
        DO 10091 I=-2,TKLAST
            IF (I.NE.0 .AND. I.NE.1) THEN
                CALL ZCHOUT(' '//TOKNAM(I)//'=',1)
                CALL ZPTINT(SPAFT(I,0),2,1)
                CALL PUTC(44)
                CALL ZPTINT(SPAFT(I,1),2,1)
                CALL PUTC(44)
                CALL ZPTINT(SPAFT(I,2),2,1)
                IF (I.GT.0 .AND. MOD(I-1,5).EQ.3) CALL PUTC(10)
            END IF
10091   CONTINUE
        CALL SKIP(2)
 
        END
C ----------------------------------------------------------------------
C
C       W R F I L E  -  Write Options File
C
 
        SUBROUTINE WRFILE(OPTPTH)
        INTEGER OPTPTH(*)
 
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.5
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
 
        COMMON/MARGIN/LMARGS,RMARGS,LMARGC,RMARGC
        INTEGER LMARGS,RMARGS,LMARGC,RMARGC
 
        COMMON/CONTIN/CONCHR,CONCNT
        INTEGER CONCHR,CONCNT
 
        COMMON/LFORM/LABELF,LABELC
        INTEGER LABELF,LABELC
 
        COMMON/INDENT/INDDO,INDIF,INDCON,INDCMT,MAXIND
        INTEGER INDDO,INDIF,INDCON,MAXIND
        LOGICAL INDCMT
 
        COMMON/SEQNUM/SEQINI,SEQINC,SEQDIG,SEQFIL,SEQRQD
        INTEGER SEQINI,SEQINC,SEQDIG,SEQFIL
        LOGICAL SEQRQD
 
        COMMON/SPACNG/SPBEF,SPAFT
        INTEGER SPBEF(-2:TKLAST,0:2),SPAFT(-2:TKLAST,0:2)
 
        COMMON/INTBRK/BRPRIO
        INTEGER BRPRIO(-2:TKLAST,0:2)
 
        COMMON/BLINES/BLAFT,BLBEF,BLADEC,BLCHAR
        INTEGER BLAFT(-2:TKLAST),BLBEF(-2:TKLAST),BLCHAR
        LOGICAL BLADEC
 
        COMMON/RELBL/FLBINI,FLBINC,SLBINI,SLBINC,RLBFMT,RLBSTM
        INTEGER FLBINI,FLBINC,SLBINI,SLBINC
        LOGICAL RLBFMT,RLBSTM
 
        COMMON/DOCON/DOCONI,NDOCON,DOCONS,IOTHCO
        LOGICAL DOCONI,IOTHCO
        INTEGER NDOCON,DOCONS(30)
 
        COMMON/CMT/CMMODE,CBOX,CBTOP,CBSIDE,CMCHAR
        INTEGER CMMODE,CBOX,CBTOP,CBSIDE,CMCHAR
 
        COMMON/CASE/KWCASE,IDCASE,STRCAS,CMCASE,FFCASE
        INTEGER KWCASE,IDCASE,STRCAS,CMCASE,FFCASE
 
        COMMON/MOVFMT/MOVEF,MFFLAG
        LOGICAL MOVEF,MFFLAG
 
        COMMON/ASGLUP/VLEN
        INTEGER VLEN
 
        COMMON/DECLUP/DLUP,DLEN,DLUPOS
        LOGICAL DLUP
        INTEGER DLEN,DLUPOS
 
        COMMON/TRCOPT/TRACE
        LOGICAL TRACE
 
        COMMON/OPT15C/INDDOC,DELSED,BRKLIF
        LOGICAL INDDOC,DELSED,BRKLIF
 
        COMMON/ERROPT/ERRCMT
        LOGICAL ERRCMT
 
        COMMON/CVTOPT/CVTHFM,FMSBRK
        LOGICAL CVTHFM,FMSBRK
 
        COMMON/REMTOK/RMOPCF
        LOGICAL RMOPCF
 
        COMMON/TNAMES/TOKNAM
        CHARACTER*6 TOKNAM(-2:TKLAST)
 
        INTEGER FPRMPT(19)
 
        SAVE
 
        INTEGER IOD,JUNK,I,J
 
        INTEGER ZGTCMD,CREATE
        EXTERNAL REMARK,ZPRMPT,ZGTCMD,CREATE,ZCHOUT,ZPTINT,PUTCH,ZMESS
 
        DATA FPRMPT/79,112,116,105,111,110,32,102,105,108,
     +              101,32,110,97,109,101,58,32,129/
 
        IOD=CREATE(OPTPTH,1)
        IF (IOD.EQ.-1) THEN
            CALL CANT(OPTPTH)
            CALL ZPRMPT(FPRMPT)
            JUNK=ZGTCMD(OPTPTH,0)
            IOD=CREATE(OPTPTH,1)
        END IF
        IF (IOD.EQ.-1) THEN
            CALL REMARK('File creation failed - command aborted')
            RETURN
        END IF
C /TRCOPT/
        CALL ZCHOUT('TRACE=',IOD)
        CALL OUTLOG(TRACE,IOD)
C /MARGIN/
        CALL ZCHOUT('LMARGS=',IOD)
        CALL ZPTINT(LMARGS,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('RMARGS=',IOD)
        CALL ZPTINT(RMARGS,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('LMARGC=',IOD)
        CALL ZPTINT(LMARGC,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('RMARGC=',IOD)
        CALL ZPTINT(RMARGC,1,IOD)
        CALL PUTCH(10,IOD)
C /CONTIN/
        CALL ZCHOUT('CONCHR=',IOD)
        CALL OUTCCH(CONCHR,IOD)
C /LFORM/
        CALL ZCHOUT('LABELC=',IOD)
        CALL ZPTINT(LABELC,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('LABELF=',IOD)
        CALL OUTLBF(LABELF,IOD)
C /INDENT/
        CALL ZCHOUT('INDDO=',IOD)
        CALL ZPTINT(INDDO,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('INDIF=',IOD)
        CALL ZPTINT(INDIF,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('INDCON=',IOD)
        CALL ZPTINT(INDCON,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('INDCMT=',IOD)
        CALL OUTLOG(INDCMT,IOD)
C /SEQNUM/
        CALL ZCHOUT('SEQRQD=',IOD)
        CALL OUTLOG(SEQRQD,IOD)
        CALL ZCHOUT('SEQINI=',IOD)
        CALL ZPTINT(SEQINI,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('SEQINC=',IOD)
        CALL ZPTINT(SEQINC,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('SEQDIG=',IOD)
        CALL ZPTINT(SEQDIG,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('SEQFIL=''',IOD)
        CALL PUTCH(SEQFIL,IOD)
        CALL ZMESS('''',IOD)
C /RELBL/
        CALL ZCHOUT('RLBFMT=',IOD)
        CALL OUTLOG(RLBFMT,IOD)
        CALL ZCHOUT('RLBSTM=',IOD)
        CALL OUTLOG(RLBSTM,IOD)
        CALL ZCHOUT('FLBINI=',IOD)
        CALL ZPTINT(FLBINI,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('FLBINC=',IOD)
        CALL ZPTINT(FLBINC,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('SLBINI=',IOD)
        CALL ZPTINT(SLBINI,1,IOD)
        CALL PUTCH(10,IOD)
        CALL ZCHOUT('SLBINC=',IOD)
        CALL ZPTINT(SLBINC,1,IOD)
        CALL PUTCH(10,IOD)
C /DOCON/
        CALL ZCHOUT('DOCONI=',IOD)
        CALL OUTLOG(DOCONI,IOD)
        CALL ZCHOUT('IOTHCO=',IOD)
        CALL OUTLOG(IOTHCO,IOD)
C /CMT/
        CALL ZCHOUT('CMMODE=',IOD)
        CALL OUTCMM(CMMODE,IOD)
        CALL ZCHOUT('CBOX=',IOD)
        CALL OUTCBX(CBOX,IOD)
        CALL ZCHOUT('CBTOP=',IOD)
        CALL PUTCH(39,IOD)
        CALL PUTCH(CBTOP,IOD)
        CALL ZMESS('''',IOD)
        CALL ZCHOUT('CBSIDE=',IOD)
        CALL PUTCH(39,IOD)
        CALL PUTCH(CBSIDE,IOD)
        CALL ZMESS('''',IOD)
        CALL ZCHOUT('CMCHAR=',IOD)
        CALL PUTCH(39,IOD)
        CALL PUTCH(CMCHAR,IOD)
        CALL ZMESS('''',IOD)
C /CASE/
        CALL ZCHOUT('KWCASE=',IOD)
        CALL OUTKWC(KWCASE,IOD)
        CALL ZCHOUT('IDCASE=',IOD)
        CALL OUTCAS(IDCASE,IOD)
        CALL ZCHOUT('STRCAS=',IOD)
        CALL OUTCAS(STRCAS,IOD)
        CALL ZCHOUT('CMCASE=',IOD)
        CALL OUTCAS(CMCASE,IOD)
        CALL ZCHOUT('FFCASE=',IOD)
        CALL OUTCAS(FFCASE,IOD)
C /ASGLUP/
        CALL ZCHOUT('VLEN=',IOD)
        CALL ZPTINT(VLEN,1,IOD)
        CALL PUTCH(10,IOD)
C /DECLUP/
        CALL ZCHOUT('DLUP=',IOD)
        CALL OUTLOG(DLUP,IOD)
        CALL ZCHOUT('DLEN=',IOD)
        CALL ZPTINT(DLEN,1,IOD)
        CALL PUTCH(10,IOD)
C /MOVFMT/
        CALL ZCHOUT('MOVEF=',IOD)
        CALL OUTLOG(MOVEF,IOD)
C /SPACNG/,/INTBRK/,/BLINES/
        CALL ZCHOUT('BLADEC=',IOD)
        CALL OUTLOG(BLADEC,IOD)
        CALL ZCHOUT('BLCHAR=''',IOD)
        CALL PUTCH(BLCHAR,IOD)
        CALL ZMESS('''',IOD)
        DO 400 I=-2,TKLAST
            IF (I.NE.0) THEN
                CALL ZCHOUT('BLBEF('//TOKNAM(I)//')=',IOD)
                CALL ZPTINT(BLBEF(I),1,IOD)
                CALL PUTCH(10,IOD)
                CALL ZCHOUT('BLAFT('//TOKNAM(I)//')=',IOD)
                CALL ZPTINT(BLAFT(I),1,IOD)
                CALL PUTCH(10,IOD)
                CALL ZCHOUT('BRPRIO('//TOKNAM(I)//')=',IOD)
                CALL PUTBRP(BRPRIO,I,IOD)
                CALL PUTCH(10,IOD)
                CALL ZCHOUT('SPBEF('//TOKNAM(I)//')=',IOD)
                DO 200 J=0,2
                    CALL ZPTINT(SPBEF(I,J),1,IOD)
 200                CALL PUTCH(32,IOD)
                CALL PUTCH(10,IOD)
                CALL ZCHOUT('SPAFT('//TOKNAM(I)//')=',IOD)
                DO 300 J=0,2
                    CALL ZPTINT(SPAFT(I,J),1,IOD)
 300                CALL PUTCH(32,IOD)
                CALL PUTCH(10,IOD)
            END IF
 400    CONTINUE
C /OPT15C/
        CALL ZCHOUT('INDDOC=',IOD)
        CALL OUTLOG(INDDOC,IOD)
        CALL ZCHOUT('DELSED=',IOD)
        CALL OUTLOG(DELSED,IOD)
        CALL ZCHOUT('BRKLIF=',IOD)
        CALL OUTLOG(BRKLIF,IOD)
C /REMTOK/
        CALL ZCHOUT('RMOPCF=',IOD)
        CALL OUTLOG(RMOPCF,IOD)
C /ERROPT/
        CALL ZCHOUT('ERRCMT=',IOD)
        CALL OUTLOG(ERRCMT,IOD)
C /CVTOPT/
        CALL ZCHOUT('CVTHFM=',IOD)
        CALL OUTLOG(CVTHFM,IOD)
        CALL ZCHOUT('FMSBRK=',IOD)
        CALL OUTLOG(FMSBRK,IOD)
 
        CALL CLOSE(IOD)
 
        END
C ----------------------------------------------------------------------
C
C       O U T L O G  -  Output .TRUE./.FALSE.
C
 
        SUBROUTINE OUTLOG(LOGVAR,IOD)
        LOGICAL LOGVAR
        INTEGER IOD
 
        EXTERNAL ZMESS
 
        IF (LOGVAR) THEN
            CALL ZMESS('..TRUE..',IOD)
        ELSE
            CALL ZMESS('..FALSE..',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T C M M  -  Output name for CMMODE
C
 
        SUBROUTINE OUTCMM(CMMODE,IOD)
        INTEGER CMMODE,IOD
 
        EXTERNAL ZMESS
 
        IF (CMMODE.EQ.0) THEN
            CALL ZMESS('normal',IOD)
        ELSE IF (CMMODE.EQ.1) THEN
            CALL ZMESS('skip_leading_blanks',IOD)
        ELSE IF (CMMODE.EQ.2) THEN
            CALL ZMESS('verbatim',IOD)
        ELSE
            CALL ZMESS('truncate',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T C C H  -  Output name for CONCHR
C
 
        SUBROUTINE OUTCCH(CONCHR,IOD)
        INTEGER CONCHR,IOD
 
        EXTERNAL ZMESS,PUTCH
 
        IF (CONCHR.EQ.1) THEN
            CALL ZMESS('numeric',IOD)
        ELSE IF (CONCHR.EQ.2) THEN
            CALL ZMESS('alphabetic',IOD)
        ELSE IF (CONCHR.EQ.3) THEN
            CALL ZMESS('alphanumeric',IOD)
        ELSE
            CALL PUTCH(39,IOD)
            CALL PUTCH(CONCHR,IOD)
            CALL ZMESS('''',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T L B F  -  Output text for LABELF
C
 
        SUBROUTINE OUTLBF(LABELF,IOD)
        INTEGER LABELF,IOD
 
        EXTERNAL ZMESS
 
        IF (LABELF.EQ.0) THEN
            CALL ZMESS('left_justified',IOD)
        ELSE IF (LABELF.EQ.1) THEN
            CALL ZMESS('right_justified',IOD)
        ELSE
            CALL ZMESS('zero_padded',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T K W C  -  Output name for keyword-case
C
 
        SUBROUTINE OUTKWC(KWCASE,IOD)
        INTEGER KWCASE,IOD
 
        EXTERNAL ZMESS
 
        IF (KWCASE.EQ.0) THEN
            CALL ZMESS('Uppercase',IOD)
        ELSE IF (KWCASE.EQ.1) THEN
            CALL ZMESS('Lowercase',IOD)
        ELSE
            CALL ZMESS('Mixedcase',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T C A S  -  Output text for other case-conversion
C
 
        SUBROUTINE OUTCAS(CASE,IOD)
        INTEGER CASE,IOD
 
        EXTERNAL ZMESS
 
        IF (CASE.EQ.0) THEN
            CALL ZMESS('Original_case',IOD)
        ELSE IF (CASE.EQ.1) THEN
            CALL ZMESS('Uppercase',IOD)
        ELSE IF (CASE.EQ.2) THEN
            CALL ZMESS('Lowercase',IOD)
        ELSE IF (CASE.EQ.3) THEN
            CALL ZMESS('Mixedcase',IOD)
        ELSE
            CALL ZMESS('Invertcase',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       O U T C B X  -  Output text for CBOX value
C
 
        SUBROUTINE OUTCBX(CBOX,IOD)
        INTEGER CBOX,IOD
 
        EXTERNAL ZMESS
 
        IF (CBOX.EQ.0) THEN
            CALL ZMESS('none',IOD)
        ELSE IF (CBOX.EQ.1) THEN
            CALL ZMESS('half_box',IOD)
        ELSE IF (CBOX.EQ.2) THEN
            CALL ZMESS('whole_box',IOD)
        END IF
 
        END
C ----------------------------------------------------------------------
C
C       P U T B R P  -  Put break-priority value to IOD
C
 
        SUBROUTINE PUTBRP(BRPRIO,I,IOD)
C---------------------------------------------------------
C    TOOLPACK/1    Release: 2.5
C---------------------------------------------------------
C
C  TKLAST = LAST TOKEN NUMBER
C
      INTEGER TZEOF ,TASSIG,TBACKS,TBLOCK,TCALL ,TCLOSE,TCOMMO,TCONTI,
     +        TDATA ,TDO   ,TDIMEN,TELSE ,TELSIF,TEND  ,TENDFI,TENDIF,
     +        TENTRY,TEQUIV,TEXTER,TFUNCT,TFORMA,TGOTO ,TIF   ,TIMPLI,
     +        TINQUI,TINTRI,TOPEN ,TPARAM,TPAUSE,TPRINT,TPROGR,TREAD ,
     +        TRETUR,TREWIN,TSAVE ,TSTOP ,TSUBRO,TTHEN ,TTO   ,TWRITE,
     +        TINTEG,TREAL ,TDOUBL,TCOMPL,TLOGIC,TCHARA,TDCMPL,TCOMMA,
     +        TEQUAL,TCOLON,TLPARN,TRPARN,TLE   ,TLT   ,TEQ   ,TNE   ,
     +        TGE   ,TGT   ,TAND  ,TOR   ,TEQV  ,TNEQV ,TNOT  ,TSTAR ,
     +        TDSTAR,TPLUS ,TMINUS,TSLASH,TCNCAT,TDCNST,TLCNST,TRCNST,
     +        TPCNST,TCCNST,THCNST,TNAME ,TFIELD,TSCALE,TZEOS ,TCMMNT,
     +        TFMTKD,TENDKD,TERRKD,TKLAST
      PARAMETER (TZEOF = 1,TASSIG= 2,TBACKS= 3,TBLOCK= 4,TCALL = 5,
     +           TCLOSE= 6,TCOMMO= 7,TCONTI= 8,TDATA = 9,TDO   =10,
     +           TDIMEN=11,TELSE =12,TELSIF=13,TEND  =14,TENDFI=15,
     +           TENDIF=16,TENTRY=17,TEQUIV=18,TEXTER=19,TFUNCT=20,
     +           TFORMA=21,TGOTO =22,TIF   =23,TIMPLI=24,TINQUI=25,
     +           TINTRI=26,TOPEN =27,TPARAM=28,TPAUSE=29,TPRINT=30,
     +           TPROGR=31,TREAD =32,TRETUR=33,TREWIN=34,TSAVE =35,
     +           TSTOP =36,TSUBRO=37,TTHEN =38,TTO   =39,TWRITE=40,
     +           TINTEG=41,TREAL =42,TDOUBL=43,TCOMPL=44,TLOGIC=45,
     +           TCHARA=46,TDCMPL=47,TCOMMA=48,TEQUAL=49,TCOLON=50,
     +           TLPARN=51,TRPARN=52,TLE   =53,TLT   =54,TEQ   =55,
     +           TNE   =56,TGE   =57,TGT   =58,TAND  =59,TOR   =60,
     +           TEQV  =61,TNEQV =62,TNOT  =63,TSTAR =64,TDSTAR=65,
     +           TPLUS =66,TMINUS=67,TSLASH=68,TCNCAT=69,TDCNST=70,
     +           TLCNST=71,TRCNST=72,TPCNST=73,TCCNST=74,THCNST=75,
     +           TNAME =76,TFIELD=77,TSCALE=78,TZEOS =79,TCMMNT=80,
     +           TFMTKD=81,TENDKD=82,TERRKD=83,TKLAST=83)
 
        INTEGER BRPRIO(-2:TKLAST,0:2),I,IOD
 
        EXTERNAL ZPTINT,PUTCH
 
        CALL ZPTINT(BRPRIO(I,0),2,IOD)
        CALL PUTCH(44,IOD)
        CALL ZPTINT(BRPRIO(I,1),2,IOD)
        CALL PUTCH(44,IOD)
        CALL ZPTINT(BRPRIO(I,2),2,IOD)
 
        END
